﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using vgo_vs01.Models.DoiTuong;
using vgo_vs01.Models.KetNoi;

namespace vgo_vs01.Models
{
    public class VatPhamModels
    {
        public List<VatPham> LayVatPham()
        {
  
            List<VatPham> dsvp = new List<VatPham>();
            ConnectDB con = new ConnectDB();
            string sql = "select*from VatPham";
            con.ExeReader(sql);
            while (con.dataRead.Read())
            {
                VatPham vp = new VatPham();
                vp.MaVatPham =int.Parse(con.dataRead["MaVatPham"].ToString());
                vp.TenVatPham = con.dataRead["TenVatPham"].ToString();
                dsvp.Add(vp);
 
            }
            return dsvp;
        }
    }
}